<?php
$allcategory = $this->category->get_all_category();

?>

<div  id="mainright">
            <div  id="sidefixed"  style="position: static; top: 0px;">


                <div  id="sidetags">
                    <h3><span>热门分类</span></h3>
                    <div  class="tags"> 
                        <?php foreach($allcategory as $v){ ?>
                        <span> <a  href="<?php echo site_url('sm/category/' . $v['id']) ?>"  title="查看<?php echo $v['title'];?>下的好东西"><?php echo $v['title'];?></a> </span>
                        <?php }?>
                        <div  class="clear"></div>
                    </div>
                </div>
                <div  id="sidetags">
                    <?php echo SIDERGG;?>
                </div>
            </div>
<script  type="text/javascript">
                $(function() {

                    var baseTop = $("#mainright").offset().top;
                    var footTop = $("#footerflag").offset().top;
                    var fixedH = $("#sidefixed").height();

                    $(window).scroll(function() {
                        var moveLen = $(window).scrollTop();
                        if (moveLen >= (baseTop) && moveLen <= (footTop - fixedH)) {
                            $("#sidefixed").css({"position": "fixed", "top": "0"});
                        } else if (moveLen > (footTop - fixedH)) {
                            $("#sidefixed").css({"position": "fixed", "top": -(moveLen - footTop + fixedH) + "px"});
                        } else {
                            $("#sidefixed").css({"position": "static"});
                        }
                    });

                });
            </script> 
        </div>
        <div  class="clear"></div>
    </div>
    <div  id="footerflag"></div>
    <div  id="footer">
        <div  class="copyright">
            <div  class="footernav"><?php echo FOOTERGG;?> <span><a  href="<?php echo base_url() . 'sitemap.html' ?>" target="_blank">站点地图</a></span> | <span><a  href="<?php echo base_url() . 'sitemap_clmao.xml' ?>" target="_blank">XML地图</a></span> | Code By <a href="http://blog.clmao.com" title="常乐猫博客">Clmao</a> </div>
            版权申明：本站分享的图片均来源于网络，若侵犯到您的权益，请及时与本站联系！<br />
            <?php if(current_url() == base_url().'index.php') {$linArr = $this->link->get_all_link('link');?>
            友情链接：<?php  foreach ($linArr as $key => $value) { ?>
            <a href="<?php echo $value['src'];?>" target="_blank"><?php echo $value['title'];?></a>&nbsp;&nbsp;

            <?php   }} ?>
    </div>
    
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"4","bdPos":"right","bdTop":"163.5"}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
</html>